    let span = document.getElementById('span')
    let btns = document.getElementById('s')
    let btnx = document.getElementById('x')
    let btnz = document.getElementById('z')
    let btny = document.getElementById('y')
    let bz = document.getElementById('bb')
    let div = document.getElementById('bj')
    let timedo
    let timeIdy
    let timeIdz
    let timeIds
    let x = span.style.left = "0px"
    let y = span.style.bottom = "0px"
    let divx = div.style.left
    let z = 0
    let z1 = 0
    let w = 0
    let v
    //////

    juliy = function () {
        x = parseInt(x)
        divx = parseInt(x)
        let i = x - 150
        if (i > 1300) {
            i = 1300
        } else if (i < 0) {
            i = 0
        }
        div.style.left = -i + 'px'
    }
    juliz = function () {
        x = parseInt(x)
        divx = parseInt(x)
        let i = x - 150
        if (i < 0) {
            i = 0
        } else if (i > 1300) {
            i = 1300
        }
        div.style.left = -i + 'px'
    }
    ///////
    btny.onmousedown = function () {

        span.style.transform = 'rotateY(0deg)'
        span.style.backgroundImage = 'url(../img/游戏/pao.gif)'
        timeIdy = setInterval(you, 30)
    }
    you = function () {
        juliy()
        x = parseInt(x)
        if (x >= 1950) {
            x = 1950
        }
        x += 5
        span.style.left = x + 'px'
    }
    btny.onmouseup = function () {
        span.style.backgroundImage = 'url(../img/游戏/zou.PNG)'
        clearInterval(timeIdy)
    }
    btnz.onmousedown = function () {
        span.style.backgroundImage = 'url(../img/游戏/pao.gif)'
        span.style.transform = 'rotateY(180deg)'
        timeIdz = setInterval(zuo, 30)
    }
    zuo = function () {
        juliz()
        x = parseInt(x)
        if (x <= 0) {
            x = 0
        }
        x -= 5
        span.style.left = x + 'px'
    }
    btnz.onmouseup = function () {
        span.style.backgroundImage = 'url(../img/游戏/zou.PNG)'
        clearInterval(timeIdz)
    }
    btns.onmousedown = function () {
        span.style.backgroundImage = 'url(../img/游戏/pao.gif)'
        clearInterval(timeIds)
        timeIds = setInterval(shang, 30)
    }
    shang = function () {
        y = parseInt(y)
        z++
        if (z < 16) {
            y += 8
        } else if (z < 31) {
            y -= 8
        } else if (z >= 31) {
            z = 0
            y = 0
            span.style.backgroundImage = 'url(../img/游戏/zou.PNG)'
            clearInterval(timeIds)
        }
        span.style.bottom = y + 'px'
    }
    document.onkeydown = function (e) {
        span.style.backgroundImage = 'url(../img/游戏/pao.gif)'
        if (e.keyCode == 87) {
            clearInterval(timeIds)
            timeIds = setInterval(shang, 30)
        }
        if (e.keyCode == 68) {
            juliy()
            span.style.transform = 'rotateY(0deg)'
            x = parseInt(x)
            if (x > 1940) {
                x = 1940
            } else {
                x += 10 
            }
            
            span.style.left = x + 'px'
        }
        if (e.keyCode == 65) {
            juliz()
            span.style.transform = 'rotateY(180deg)'
            x = parseInt(x)
            if (x <0) {
                x = 0
            } else {
                x -= 10
            }
            
            span.style.left = x + 'px'
        }
    }
    div.onmousedown = function () {
        clearInterval(timedo)
        timedo = setInterval(faill, 10)
    }

    faill = function () {
        z1++
        if (z1 < 6) {
            v += 18
        } else if (z1 < 11) {
            v -= 18
        } else if (z1 >= 16) {
            z1 = 0
            v = 0

            clearInterval(timeIds)
        }
        bz.style.transform = `rotateZ(${v}deg)`
    }
    div.onmouseup = function () {
        clearInterval(timedo)
    }
    btnx.onmousedown = function () {
        clearInterval(timedo)
        timedo = setInterval(faill, 10)
    }
    faill = function () {
        z1++
        if (z1 < 6) {
            v += 18
        } else if (z1 < 11) {
            v -= 18
        } else if (z1 >= 16) {
            z1 = 0
            v = 0
            clearInterval(timeIds)
        }
        bz.style.transform = `rotateZ(${v}deg)`
    }
    btnx.onmouseup = function () {
        clearInterval(timedo)
    }
    document.onkeyup = function (e) {
        span.style.backgroundImage = 'url(../img/游戏/zou.PNG)'
        clearInterval(timedo)
}
    //
    let play = document.getElementById('play')
    let zdc = document.getElementById('zdc')
    play.onclick = function () {
        zdc.style.display = 'none'
    }